<template>
  <div class="gaikuang">
    <li>统计时间：{{ mktime }}</li>

        <div class="left">
            <img src="\images\jinghe\right\企业总数@2x.png">
            <img  v-if="industryRank==1" class="leftNO1" src="\images\jinghe\right\第一名小标@2x.png">
            <img v-else class="leftNO1" src="\images\jinghe\right\不是第一名小标@2x.png">
            <div class="industryRank" >NO.{{ industryRank }}</div>
            <div class="enterprisesNum" >{{ industryNum }}</div>
            <h1>行业总数</h1>
        </div>
        <div class="right">
            <img src="\images\jinghe\right\企业总数@2x.png">
            <img v-if="patenRank==1" class="rightNO1"  src="\images\jinghe\right\第一名小标@2x.png">
            <img v-else class="rightNO1" src="\images\jinghe\right\不是第一名小标@2x.png">
            <div class="patenRank">
              NO.{{ patenRank }}
            </div>
            <div class="patenNum">{{ patenNum }}</div>
            <h1>创新专利数</h1>
        </div>
    <!-- </div> -->
    <!-- <div class="right">
      <img src="\images\jinghe\right\企业总数@2x.png" />
      <img
        v-if="patenRank == 1"
        class="rightNO1"
        src="\images\jinghe\right\第一名小标@2x.png"
      />
      <img
        v-else
        class="rightNO1"
        src="\images\jinghe\right\不是第一名小标@2x.png"
      />
      <div class="patenRank">NO.{{ patenRank }}</div>
      <div class="patenNum">{{ patenNum }}</div>
      <h1>创新专利数</h1>
    </div> -->
    <!-- <verdict :poptext="jlList" /> -->
  </div>
</template>
<script>
// import verdict from "../../components/verdict";
export default {
  name: "gaikuang2",
  data() {
    return {
      survey: {},
      enterprisesNum: "",
      patenNum: "",
      industryNum: "",
      industryRank: "",
      patenRank: "",
      mktime: "2020.12",
    };
  },
  // components: { verdict },
  props: {
    gkData: {
      type: [Object, Array],
      required: true
    }
  },
  mounted() {
    //请求first second部分数据
    // this.load();
    // this.fresh()
    this.getTime()
  },
  methods: {
    async load() {
      await this.$api
        .get("/es/jsc/cyjh_detail_cyljb", {
          params: { industry: "上游", xfhy: "轻稀土" },
        })
        .then((res) => {
          this.survey = res.data["宁波概况"];
          this.industryNum = res.data["宁波概况"]["企业总数"];
          this.patenNum = res.data["宁波概况"]["创新专利数"];

          this.industryRank = res.data["宁波概况"]["企业数排名"];
          this.patenRank = res.data["宁波概况"]["专利数排名"];
        });
    },
    fresh(){
      this.survey = this.gkData
      this.industryNum = this.survey["企业总数"];
      this.patenNum = this.survey["创新专利数"];

      this.industryRank = this.survey["企业数排名"];
      this.patenRank = this.survey["专利数排名"];
      // console.log(this.industryRank, this.patenRank)
    },
    async getTime(){
      let {data} = await this.$api.get("/es/jsc/get_time")
      this.mktime = data["统计时间"].split('.').splice(0,2).join('.')
    }
  },
  watch: {
    gkData: function() {
      this.fresh()
    }
  }
};
</script>
<style scoped>
.gaikuang li {
  position: absolute;
  top: 7px;
  right: 30px;
  display: inline-block;
  /* width: 132px; */
  height: 15px;
  font-size: 15px;
  font-family: Source Han Sans CN;
  font-weight: 400;
  line-height: 31px;
  color: #b7b7b7;

  opacity: 1;
}

.left {
  position: absolute;
  top: 45px;
  left: 45px;
  width: 125px;
  height: 96px;
}

.right {
  position: absolute;
  top: 45px;
  right: 84px;
  width: 125px;
  height: 96px;
}
.leftNO1 {
  position: absolute;
  top: 8px;
  left: 85px;
  width: 50px !important;
  height: 17px !important;
}
.leftNO3 {
  position: absolute;
  top: 8px;
  left: 80px;
  width: 40px !important;
  height: 17px !important;
}
.rightNO1 {
  position: absolute;
  top: 8px;
  right: -14px;
  width: 50px !important;
  display: inline-block;
  height: 17px !important;
}
.rightNO3 {
  position: absolute;
  top: 8px;
  right: 1.5px;
  width: 40px !important;
  height: 17px !important;
}

.industryRank {
  position: absolute;
  top: -80px;
  left: 90px;
  width: 39px;
  height: 19px;

  z-index: 9999999;
  font-size: 15px;
  font-family: Source Han Sans CN;
  font-weight: 500;
  line-height: 192px;
  color: #ffffff;
  opacity: 1;
}
.patenRank {
  position: absolute;
  top: -80px;
  right: -8px;
  width: 39px;
  height: 19px;

  font-size: 15px;
  font-family: Source Han Sans CN;
  font-weight: 500;
  line-height: 192px;
  color: #ffffff;
  opacity: 1;
}

.enterprisesNum {
  position: absolute;
  top: 15px;
  left: 4px;
  width: 116px;
  height: 25px;
  font-size: 25px;
  font-family: Source Han Sans CN;
  font-weight: 400;
  color: #1afcff;
  text-align: center;
}

.patenNum {
  position: absolute;
  top: 15px;
  left: 4px;
  width: 116px;
  height: 25px;
  font-size: 25px;
  font-family: Source Han Sans CN;
  font-weight: 400;
  color: #1afcff;
  opacity: 1;
  text-align: center;

}

.left h1 {
  position: absolute;
  top: 28px !important;
  left: 20px !important;
  width: 68px;
  height: 17px;
  font-size: 17px;
  text-align: center;
  font-family: Source Han Sans CN;
  font-weight: 500;
  line-height: 30px;
  color: #ffffff;
  opacity: 1;
}

.right h1 {
  position: absolute;
  top: 28px;
  left: 25px;
  width: 85px;
  height: 17px;
  font-size: 17px;
  font-family: Source Han Sans CN;
  font-weight: 500;
  line-height: 30px;
  color: #ffffff;
  opacity: 1;
}

.gaikuang {
  position: relative;
  top: -8px;
  width: 418px;
  height: 130px;
  /* background: rgba(3, 16, 38, 0.28);
  opacity: 0.9; */
  border-radius: 10px;
}

.left img {
  width: 100%;
  height: 100%;
}

.right img {
  width: 100%;
  height: 100%;
}
.verdict {
  position: absolute;
  top: 150px;
  left: 1px;
  width: 94% !important;
}
</style>
